# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=libsoup3
pkgver=3.0.7
pkgrel=0
pkgdesc="Gnome HTTP client/server Library"
url="https://wiki.gnome.org/Projects/libsoup"
arch="all"
options="!check" # Wants to bind to ports, which doesn't work in our environment
license="LGPL-2.0-or-later"
subpackages="$pkgname-dev $pkgname-lang $pkgname-dbg"
depends="glib-networking gsettings-desktop-schemas"
makedepends="
	brotli>=1.0.9-r1
	gobject-introspection-dev
	libgcrypt-dev
	libgpg-error-dev
	libpsl-dev
	libxml2-dev
	meson
	nghttp2-dev
	sqlite-dev
	vala
	zlib-dev
	"
source="https://download.gnome.org/sources/libsoup/${pkgver%.*}/libsoup-$pkgver.tar.xz"
builddir="$srcdir/libsoup-$pkgver"

build() {
	abuild-meson \
		-Dtls_check=false \
		-Dintrospection=enabled \
		-Dvapi=enabled \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
bb48b2475ec4b073de144ad91459843946ba902fc0849b88c548ccb774fc3854451239267dd097a3da4e40f025ae746609b669ec0caffdb15e7b07118e881cfd  libsoup-3.0.7.tar.xz
"
